package com.job.sun.HomeWork0709;

import java.sql.SQLOutput;
import java.util.Collection;
import java.util.Scanner;

/**
 * @author 张春阳
 * @version 1.0
 * @since 2022-07-11 12:21:25
 */
public class PascalTriangle {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入行数");
        int anInt = sc.nextInt();

        int[][] nums=new int[anInt][anInt];

        for(int i=0;i<anInt;i++){
            for(int j=0;j<=i;j++){

                if(j==0||i==j){
                  //首尾
                    nums[i][j]=1;
                    System.out.print(nums[i][j]+"\t");
                }else{
                    nums[i][j]=nums[i-1][j-1]+nums[i-1][j];
                    System.out.print(nums[i][j]+"\t");
                }
            }
            System.out.println();
        }
    }

}